﻿@page "/songslistredirect/"
@page "/songslistredirect/{PageNumber:int}"
@page "/songslistredirect/{SearchTerms}/{PageNumber:int}"

@code {
    [Parameter]
    public int PageNumber { get; set; } = 1;

    [Parameter]
    public string SearchTerms { get; set; } = null;

    protected override void OnInitialized()
    {
        this.NavigationManager.NavigateTo(string.IsNullOrWhiteSpace(this.SearchTerms) ?
                                              $"/songslist/{this.PageNumber}" :
                                              $"/songslist/{this.SearchTerms}/{this.PageNumber}");
    }
}
